home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / mac / developm / language / harvest.cpt / Harvest C / Tcl 6.2 / tclUnixStr.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-29  |  14.8 KB  |  729 lines

  1. #ifdef macintosh
  2. #    pragma segment tclUnixStr
  3. #endif
  4.  
  5. /* 
  6.  * tclUnixStr.c --
  7.  *
  8.  *    This file contains procedures that generate strings
  9.  *    corresponding to various UNIX-related codes, such
  10.  *    as errno and signals.
  11.  *
  12.  * Copyright 1991 Regents of the University of California
  13.  * Permission to use, copy, modify, and distribute this
  14.  * software and its documentation for any purpose and without
  15.  * fee is hereby granted, provided that this copyright
  16.  * notice appears in all copies.  The University of California
  17.  * makes no representations about the suitability of this
  18.  * software for any purpose.  It is provided "as is" without
  19.  * express or implied warranty.
  20.  */
  21.  
  22. #ifndef lint
  23. static char rcsid[] = "$Header: /user6/ouster/tcl/RCS/tclUnixStr.c,v 1.11 92/01/03 08:28:54 ouster Exp $ SPRITE (Berkeley)";
  24. #endif /* not lint */
  25.  
  26. #include "tclInt.h"
  27. #include "tclUnix.h"
  28.  
  29. /*
  30.  *----------------------------------------------------------------------
  31.  *
  32.  * Tcl_ErrnoId --
  33.  *
  34.  *    Return a textual identifier for the current errno value.
  35.  *
  36.  * Results:
  37.  *    This procedure returns a machine-readable textual identifier
  38.  *    that corresponds to the current errno value (e.g. "EPERM").
  39.  *    The identifier is the same as the #define name in errno.h.
  40.  *
  41.  * Side effects:
  42.  *    None.
  43.  *
  44.  *----------------------------------------------------------------------
  45.  */
  46.  
  47. char *
  48. Tcl_ErrnoId()
  49. {
  50.     switch (errno) {
  51. #ifdef E2BIG
  52.     case E2BIG: return "E2BIG";
  53. #endif
  54. #ifdef EACCES
  55.     case EACCES: return "EACCES";
  56. #endif
  57. #ifdef EADDRINUSE
  58.     case EADDRINUSE: return "EADDRINUSE";
  59. #endif
  60. #ifdef EADDRNOTAVAIL
  61.     case EADDRNOTAVAIL: return "EADDRNOTAVAIL";
  62. #endif
  63. #ifdef EADV
  64.     case EADV: return "EADV";
  65. #endif
  66. #ifdef EAFNOSUPPORT
  67.     case EAFNOSUPPORT: return "EAFNOSUPPORT";
  68. #endif
  69. #ifdef EAGAIN
  70.     case EAGAIN: return "EAGAIN";
  71. #endif
  72. #ifdef EALIGN
  73.     case EALIGN: return "EALIGN";
  74. #endif
  75. #ifdef EALREADY
  76.     case EALREADY: return "EALREADY";
  77. #endif
  78. #ifdef EBADE
  79.     case EBADE: return "EBADE";
  80. #endif
  81. #ifdef EBADF
  82.     case EBADF: return "EBADF";
  83. #endif
  84. #ifdef EBADFD
  85.     case EBADFD: return "EBADFD";
  86. #endif
  87. #ifdef EBADMSG
  88.     case EBADMSG: return "EBADMSG";
  89. #endif
  90. #ifdef EBADR
  91.     case EBADR: return "EBADR";
  92. #endif
  93. #ifdef EBADRPC
  94.     case EBADRPC: return "EBADRPC";
  95. #endif
  96. #ifdef EBADRQC
  97.     case EBADRQC: return "EBADRQC";
  98. #endif
  99. #ifdef EBADSLT
  100.     case EBADSLT: return "EBADSLT";
  101. #endif
  102. #ifdef EBFONT
  103.     case EBFONT: return "EBFONT";
  104. #endif
  105. #ifdef EBUSY
  106.     case EBUSY: return "EBUSY";
  107. #endif
  108. #ifdef ECHILD
  109.     case ECHILD: return "ECHILD";
  110. #endif
  111. #ifdef ECHRNG
  112.     case ECHRNG: return "ECHRNG";
  113. #endif
  114. #ifdef ECOMM
  115.     case ECOMM: return "ECOMM";
  116. #endif
  117. #ifdef ECONNABORTED
  118.     case ECONNABORTED: return "ECONNABORTED";
  119. #endif
  120. #ifdef ECONNREFUSED
  121.     case ECONNREFUSED: return "ECONNREFUSED";
  122. #endif
  123. #ifdef ECONNRESET
  124.     case ECONNRESET: return "ECONNRESET";
  125. #endif
  126. #if defined(EDEADLK) && (!defined(EWOULDBLOCK) || (EDEADLK != EWOULDBLOCK))
  127.     case EDEADLK: return "EDEADLK";
  128. #endif
  129. #ifdef EDEADLOCK
  130.     case EDEADLOCK: return "EDEADLOCK";
  131. #endif
  132. #ifdef EDESTADDRREQ
  133.     case EDESTADDRREQ: return "EDESTADDRREQ";
  134. #endif
  135. #ifdef EDIRTY
  136.     case EDIRTY: return "EDIRTY";
  137. #endif
  138. #ifdef EDOM
  139.     case EDOM: return "EDOM";
  140. #endif
  141. #ifdef EDOTDOT
  142.     case EDOTDOT: return "EDOTDOT";
  143. #endif
  144. #ifdef EDQUOT
  145.     case EDQUOT: return "EDQUOT";
  146. #endif
  147. #ifdef EDUPPKG
  148.     case EDUPPKG: return "EDUPPKG";
  149. #endif
  150. #ifdef EEXIST
  151.     case EEXIST: return "EEXIST";
  152. #endif
  153. #ifdef EFAULT
  154.     case EFAULT: return "EFAULT";
  155. #endif
  156. #ifdef EFBIG
  157.     case EFBIG: return "EFBIG";
  158. #endif
  159. #ifdef EHOSTDOWN
  160.     case EHOSTDOWN: return "EHOSTDOWN";
  161. #endif
  162. #ifdef EHOSTUNREACH
  163.     case EHOSTUNREACH: return "EHOSTUNREACH";
  164. #endif
  165. #ifdef EIDRM
  166.     case EIDRM: return "EIDRM";
  167. #endif
  168. #ifdef EINIT
  169.     case EINIT: return "EINIT";
  170. #endif
  171. #ifdef EINPROGRESS
  172.     case EINPROGRESS: return "EINPROGRESS";
  173. #endif
  174. #ifdef EINTR
  175.     case EINTR: return "EINTR";
  176. #endif
  177. #ifdef EINVAL
  178.     case EINVAL: return "EINVAL";
  179. #endif
  180. #ifdef EIO
  181.     case EIO: return "EIO";
  182. #endif
  183. #ifdef EISCONN
  184.     case EISCONN: return "EISCONN";
  185. #endif
  186. #ifdef EISDIR
  187.     case EISDIR: return "EISDIR";
  188. #endif
  189. #ifdef EISNAME
  190.     case EISNAM: return "EISNAM";
  191. #endif
  192. #ifdef ELBIN
  193.     case ELBIN: return "ELBIN";
  194. #endif
  195. #ifdef EL2HLT
  196.     case EL2HLT: return "EL2HLT";
  197. #endif
  198. #ifdef EL2NSYNC
  199.     case EL2NSYNC: return "EL2NSYNC";
  200. #endif
  201. #ifdef EL3HLT
  202.     case EL3HLT: return "EL3HLT";
  203. #endif
  204. #ifdef EL3RST
  205.     case EL3RST: return "EL3RST";
  206. #endif
  207. #ifdef ELIBACC
  208.     case ELIBACC: return "ELIBACC";
  209. #endif
  210. #ifdef ELIBBAD
  211.     case ELIBBAD: return "ELIBBAD";
  212. #endif
  213. #ifdef ELIBEXEC
  214.     case ELIBEXEC: return "ELIBEXEC";
  215. #endif
  216. #ifdef ELIBMAX
  217.     case ELIBMAX: return "ELIBMAX";
  218. #endif
  219. #ifdef ELIBSCN
  220.     case ELIBSCN: return "ELIBSCN";
  221. #endif
  222. #ifdef ELNRNG
  223.     case ELNRNG: return "ELNRNG";
  224. #endif
  225. #ifdef ELOOP
  226.     case ELOOP: return "ELOOP";
  227. #endif
  228. #ifdef EMFILE
  229.     case EMFILE: return "EMFILE";
  230. #endif
  231. #ifdef EMLINK
  232.     case EMLINK: return "EMLINK";
  233. #endif
  234. #ifdef EMSGSIZE
  235.     case EMSGSIZE: return "EMSGSIZE";
  236. #endif
  237. #ifdef EMULTIHOP
  238.     case EMULTIHOP: return "EMULTIHOP";
  239. #endif
  240. #ifdef ENAMETOOLONG
  241.     case ENAMETOOLONG: return "ENAMETOOLONG";
  242. #endif
  243. #ifdef ENAVAIL
  244.     case ENAVAIL: return "ENAVAIL";
  245. #endif
  246. #ifdef ENET
  247.     case ENET: return "ENET";
  248. #endif
  249. #ifdef ENETDOWN
  250.     case ENETDOWN: return "ENETDOWN";
  251. #endif
  252. #ifdef ENETRESET
  253.     case ENETRESET: return "ENETRESET";
  254. #endif
  255. #ifdef ENETUNREACH
  256.     case ENETUNREACH: return "ENETUNREACH";
  257. #endif
  258. #ifdef ENFILE
  259.     case ENFILE: return "ENFILE";
  260. #endif
  261. #ifdef ENOANO
  262.     case ENOANO: return "ENOANO";
  263. #endif
  264. #if defined(ENOBUFS) && (!defined(ENOSR) || (ENOBUFS != ENOSR))
  265.     case ENOBUFS: return "ENOBUFS";
  266. #endif
  267. #ifdef ENOCSI
  268.     case ENOCSI: return "ENOCSI";
  269. #endif
  270. #ifdef ENODATA
  271.     case ENODATA: return "ENODATA";
  272. #endif
  273. #ifdef ENODEV
  274.     case ENODEV: return "ENODEV";
  275. #endif
  276. #ifdef ENOENT
  277.     case ENOENT: return "ENOENT";
  278. #endif
  279. #ifdef ENOEXEC
  280.     case ENOEXEC: return "ENOEXEC";
  281. #endif
  282. #ifdef ENOLCK
  283.     case ENOLCK: return "ENOLCK";
  284. #endif
  285. #ifdef ENOLINK
  286.     case ENOLINK: return "ENOLINK";
  287. #endif
  288. #ifdef ENOMEM
  289.     case ENOMEM: return "ENOMEM";
  290. #endif
  291. #ifdef ENOMSG
  292.     case ENOMSG: return "ENOMSG";
  293. #endif
  294. #ifdef ENONET
  295.     case ENONET: return "ENONET";
  296. #endif
  297. #ifdef ENOPKG
  298.     case ENOPKG: return "ENOPKG";
  299. #endif
  300. #ifdef ENOPROTOOPT
  301.     case ENOPROTOOPT: return "ENOPROTOOPT";
  302. #endif
  303. #ifdef ENOSPC
  304.     case ENOSPC: return "ENOSPC";
  305. #endif
  306. #ifdef ENOSR
  307.     case ENOSR: return "ENOSR";
  308. #endif
  309. #ifdef ENOSTR
  310.     case ENOSTR: return "ENOSTR";
  311. #endif
  312. #ifdef ENOSYM
  313.     case ENOSYM: return "ENOSYM";
  314. #endif
  315. #ifdef ENOSYS
  316.     case ENOSYS: return "ENOSYS";
  317. #endif
  318. #ifdef ENOTBLK
  319.     case ENOTBLK: return "ENOTBLK";
  320. #endif
  321. #ifdef ENOTCONN
  322.     case ENOTCONN: return "ENOTCONN";
  323. #endif
  324. #ifdef ENOTDIR
  325.     case ENOTDIR: return "ENOTDIR";
  326. #endif
  327. #if defined(ENOTEMPTY) && (!defined(EEXIST) || (ENOTEMPTY != EEXIST))
  328.     case ENOTEMPTY: return "ENOTEMPTY";
  329. #endif
  330. #ifdef ENOTNAM
  331.     case ENOTNAM: return "ENOTNAM";
  332. #endif
  333. #ifdef ENOTSOCK
  334.     case ENOTSOCK: return "ENOTSOCK";
  335. #endif
  336. #ifdef ENOTTY
  337.     case ENOTTY: return "ENOTTY";
  338. #endif
  339. #ifdef ENOTUNIQ
  340.     case ENOTUNIQ: return "ENOTUNIQ";
  341. #endif
  342. #ifdef ENXIO
  343.     case ENXIO: return "ENXIO";
  344. #endif
  345. #ifdef EOPNOTSUPP
  346.     case EOPNOTSUPP: return "EOPNOTSUPP";
  347. #endif
  348. #ifdef EPERM
  349.     case EPERM: return "EPERM";
  350. #endif
  351. #ifdef EPFNOSUPPORT
  352.     case EPFNOSUPPORT: return "EPFNOSUPPORT";
  353. #endif
  354. #ifdef EPIPE
  355.     case EPIPE: return "EPIPE";
  356. #endif
  357. #ifdef EPROCLIM
  358.     case EPROCLIM: return "EPROCLIM";
  359. #endif
  360. #ifdef EPROCUNAVAIL
  361.     case EPROCUNAVAIL: return "EPROCUNAVAIL";
  362. #endif
  363. #ifdef EPROGMISMATCH
  364.     case EPROGMISMATCH: return "EPROGMISMATCH";
  365. #endif
  366. #ifdef EPROGUNAVAIL
  367.     case EPROGUNAVAIL: return "EPROGUNAVAIL";
  368. #endif
  369. #ifdef EPROTO
  370.     case EPROTO: return "EPROTO";
  371. #endif
  372. #ifdef EPROTONOSUPPORT
  373.     case EPROTONOSUPPORT: return "EPROTONOSUPPORT";
  374. #endif
  375. #ifdef EPROTOTYPE
  376.     case EPROTOTYPE: return "EPROTOTYPE";
  377. #endif
  378. #ifdef ERANGE
  379.     case ERANGE: return "ERANGE";
  380. #endif
  381. #if defined(EREFUSED) && (!defined(ECONNREFUSED) || (EREFUSED != ECONNREFUSED))
  382.     case EREFUSED: return "EREFUSED";
  383. #endif
  384. #ifdef EREMCHG
  385.     case EREMCHG: return "EREMCHG";
  386. #endif
  387. #ifdef EREMDEV
  388.     case EREMDEV: return "EREMDEV";
  389. #endif
  390. #ifdef EREMOTE
  391.     case EREMOTE: return "EREMOTE";
  392. #endif
  393. #ifdef EREMOTEIO
  394.     case EREMOTEIO: return "EREMOTEIO";
  395. #endif
  396. #ifdef EREMOTERELEASE
  397.     case EREMOTERELEASE: return "EREMOTERELEASE";
  398. #endif
  399. #ifdef EROFS
  400.     case EROFS: return "EROFS";
  401. #endif
  402. #ifdef ERPCMISMATCH
  403.     case ERPCMISMATCH: return "ERPCMISMATCH";
  404. #endif
  405. #ifdef ERREMOTE
  406.     case ERREMOTE: return "ERREMOTE";
  407. #endif
  408. #ifdef ESHUTDOWN
  409.     case ESHUTDOWN: return "ESHUTDOWN";
  410. #endif
  411. #ifdef ESOCKTNOSUPPORT
  412.     case ESOCKTNOSUPPORT: return "ESOCKTNOSUPPORT";
  413. #endif
  414. #ifdef ESPIPE
  415.     case ESPIPE: return "ESPIPE";
  416. #endif
  417. #ifdef ESRCH
  418.     case ESRCH: return "ESRCH";
  419. #endif
  420. #ifdef ESRMNT
  421.     case ESRMNT: return "ESRMNT";
  422. #endif
  423. #ifdef ESTALE
  424.     case ESTALE: return "ESTALE";
  425. #endif
  426. #ifdef ESUCCESS
  427.     case ESUCCESS: return "ESUCCESS";
  428. #endif
  429. #ifdef ETIME
  430.     case ETIME: return "ETIME";
  431. #endif
  432. #ifdef ETIMEDOUT
  433.     case ETIMEDOUT: return "ETIMEDOUT";
  434. #endif
  435. #ifdef ETOOMANYREFS
  436.     case ETOOMANYREFS: return "ETOOMANYREFS";
  437. #endif
  438. #ifdef ETXTBSY
  439.     case ETXTBSY: return "ETXTBSY";
  440. #endif
  441. #ifdef EUCLEAN
  442.     case EUCLEAN: return "EUCLEAN";
  443. #endif
  444. #ifdef EUNATCH
  445.     case EUNATCH: return "EUNATCH";
  446. #endif
  447. #ifdef EUSERS
  448.     case EUSERS: return "EUSERS";
  449. #endif
  450. #ifdef EVERSION
  451.     case EVERSION: return "EVERSION";
  452. #endif
  453. #if defined(EWOULDBLOCK) && (!defined(EAGAIN) || (EWOULDBLOCK != EAGAIN))
  454.     case EWOULDBLOCK: return "EWOULDBLOCK";
  455. #endif
  456. #ifdef EXDEV
  457.     case EXDEV: return "EXDEV";
  458. #endif
  459. #ifdef EXFULL
  460.     case EXFULL: return "EXFULL";
  461. #endif
  462.     }
  463.     return "unknown error";
  464. }
  465.  
  466. /*
  467.  *----------------------------------------------------------------------
  468.  *
  469.  * Tcl_SignalId --
  470.  *
  471.  *    Return a textual identifier for a signal number.
  472.  *
  473.  * Results:
  474.  *    This procedure returns a machine-readable textual identifier
  475.  *    that corresponds to sig.  The identifier is the same as the
  476.  *    #define name in signal.h.
  477.  *
  478.  * Side effects:
  479.  *    None.
  480.  *
  481.  *----------------------------------------------------------------------
  482.  */
  483.  
  484. char *
  485. Tcl_SignalId(sig)
  486.     int sig;            /* Number of signal. */
  487. {
  488.     switch (sig) {
  489. #ifdef SIGABRT
  490.     case SIGABRT: return "SIGABRT";
  491. #endif
  492. #ifdef SIGALRM
  493.     case SIGALRM: return "SIGALRM";
  494. #endif
  495. #ifdef SIGBUS
  496.     case SIGBUS: return "SIGBUS";
  497. #endif
  498. #ifdef SIGCHLD
  499.     case SIGCHLD: return "SIGCHLD";
  500. #endif
  501. #if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
  502.     case SIGCLD: return "SIGCLD";
  503. #endif
  504. #ifdef SIGCONT
  505.     case SIGCONT: return "SIGCONT";
  506. #endif
  507. #ifdef SIGEMT
  508.     case SIGEMT: return "SIGEMT";
  509. #endif
  510. #ifdef SIGFPE
  511.     case SIGFPE: return "SIGFPE";
  512. #endif
  513. #ifdef SIGHUP
  514.     case SIGHUP: return "SIGHUP";
  515. #endif
  516. #ifdef SIGILL
  517.     case SIGILL: return "SIGILL";
  518. #endif
  519. #ifdef SIGINT
  520.     case SIGINT: return "SIGINT";
  521. #endif
  522. #ifdef SIGIO
  523.     case SIGIO: return "SIGIO";
  524. #endif
  525. #if defined(SIGIOT) && (!defined(SIGABRT) || (SIGIOT != SIGABRT))
  526.     case SIGIOT: return "SIGIOT";
  527. #endif
  528. #ifdef SIGKILL
  529.     case SIGKILL: return "SIGKILL";
  530. #endif
  531. #if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT))
  532.     case SIGLOST: return "SIGLOST";
  533. #endif
  534. #ifdef SIGPIPE
  535.     case SIGPIPE: return "SIGPIPE";
  536. #endif
  537. #if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
  538.     case SIGPOLL: return "SIGPOLL";
  539. #endif
  540. #ifdef SIGPROF
  541.     case SIGPROF: return "SIGPROF";
  542. #endif
  543. #ifdef SIGPWR
  544.     case SIGPWR: return "SIGPWR";
  545. #endif
  546. #ifdef SIGQUIT
  547.     case SIGQUIT: return "SIGQUIT";
  548. #endif
  549. #ifdef SIGSEGV
  550.     case SIGSEGV: return "SIGSEGV";
  551. #endif
  552. #ifdef SIGSTOP
  553.     case SIGSTOP: return "SIGSTOP";
  554. #endif
  555. #ifdef SIGSYS
  556.     case SIGSYS: return "SIGSYS";
  557. #endif
  558. #ifdef SIGTERM
  559.     case SIGTERM: return "SIGTERM";
  560. #endif
  561. #ifdef SIGTRAP
  562.     case SIGTRAP: return "SIGTRAP";
  563. #endif
  564. #ifdef SIGTSTP
  565.     case SIGTSTP: return "SIGTSTP";
  566. #endif
  567. #ifdef SIGTTIN
  568.     case SIGTTIN: return "SIGTTIN";
  569. #endif
  570. #ifdef SIGTTOU
  571.     case SIGTTOU: return "SIGTTOU";
  572. #endif
  573. #ifdef SIGURG
  574.     case SIGURG: return "SIGURG";
  575. #endif
  576. #ifdef SIGUSR1
  577.     case SIGUSR1: return "SIGUSR1";
  578. #endif
  579. #ifdef SIGUSR2
  580.     case SIGUSR2: return "SIGUSR2";
  581. #endif
  582. #ifdef SIGVTALRM
  583.     case SIGVTALRM: return "SIGVTALRM";
  584. #endif
  585. #ifdef SIGWINCH
  586.     case SIGWINCH: return "SIGWINCH";
  587. #endif
  588. #ifdef SIGXCPU
  589.     case SIGXCPU: return "SIGXCPU";
  590. #endif
  591. #if defined(SIGXFSZ) && (!defined(SIGPWR) || (SIGXFSZ != SIGPWR))
  592.     case SIGXFSZ: return "SIGXFSZ";
  593. #endif
  594.     }
  595.     return "unknown signal";
  596. }
  597.  
  598. /*
  599.  *----------------------------------------------------------------------
  600.  *
  601.  * Tcl_SignalMsg --
  602.  *
  603.  *    Return a human-readable message describing a signal.
  604.  *
  605.  * Results:
  606.  *    This procedure returns a string describing sig that should
  607.  *    make sense to a human.  It may not be easy for a machine
  608.  *    to parse.
  609.  *
  610.  * Side effects:
  611.  *    None.
  612.  *
  613.  *----------------------------------------------------------------------
  614.  */
  615.  
  616. char *
  617. Tcl_SignalMsg(sig)
  618.     int sig;            /* Number of signal. */
  619. {
  620.     switch (sig) {
  621. #ifdef SIGABRT
  622.     case SIGABRT: return "SIGABRT";
  623. #endif
  624. #ifdef SIGALRM
  625.     case SIGALRM: return "alarm clock";
  626. #endif
  627. #ifdef SIGBUS
  628.     case SIGBUS: return "bus error";
  629. #endif
  630. #ifdef SIGCHLD
  631.     case SIGCHLD: return "child status changed";
  632. #endif
  633. #if defined(SIGCLD) && (!defined(SIGCHLD) || (SIGCLD != SIGCHLD))
  634.     case SIGCLD: return "child status changed";
  635. #endif
  636. #ifdef SIGCONT
  637.     case SIGCONT: return "continue after stop";
  638. #endif
  639. #ifdef SIGEMT
  640.     case SIGEMT: return "EMT instruction";
  641. #endif
  642. #ifdef SIGFPE
  643.     case SIGFPE: return "floating-point exception";
  644. #endif
  645. #ifdef SIGHUP
  646.     case SIGHUP: return "hangup";
  647. #endif
  648. #ifdef SIGILL
  649.     case SIGILL: return "illegal instruction";
  650. #endif
  651. #ifdef SIGINT
  652.     case SIGINT: return "interrupt";
  653. #endif
  654. #ifdef SIGIO
  655.     case SIGIO: return "input/output possible on file";
  656. #endif
  657. #if defined(SIGIOT) && (!defined(SIGABRT) || (SIGABRT != SIGIOT))
  658.     case SIGIOT: return "IOT instruction";
  659. #endif
  660. #ifdef SIGKILL
  661.     case SIGKILL: return "kill signal";
  662. #endif
  663. #if defined(SIGLOST) && (!defined(SIGIOT) || (SIGLOST != SIGIOT))
  664.     case SIGLOST: return "resource lost";
  665. #endif
  666. #ifdef SIGPIPE
  667.     case SIGPIPE: return "write on pipe with no readers";
  668. #endif
  669. #if defined(SIGPOLL) && (!defined(SIGIO) || (SIGPOLL != SIGIO))
  670.     case SIGPOLL: return "input/output possible on file";
  671. #endif
  672. #ifdef SIGPROF
  673.     case SIGPROF: return "profiling alarm";
  674. #endif
  675. #ifdef SIGPWR
  676.     case SIGPWR: return "power-fail restart";
  677. #endif
  678. #ifdef SIGQUIT
  679.     case SIGQUIT: return "quit signal";
  680. #endif
  681. #ifdef SIGSEGV
  682.     case SIGSEGV: return "segmentation violation";
  683. #endif
  684. #ifdef SIGSTOP
  685.     case SIGSTOP: return "stop";
  686. #endif
  687. #ifdef SIGSYS
  688.     case SIGSYS: return "bad argument to system call";
  689. #endif
  690. #ifdef SIGTERM
  691.     case SIGTERM: return "software termination signal";
  692. #endif
  693. #ifdef SIGTRAP
  694.     case SIGTRAP: return "trace trap";
  695. #endif
  696. #ifdef SIGTSTP
  697.     case SIGTSTP: return "stop signal from tty";
  698. #endif
  699. #ifdef SIGTTIN
  700.     case SIGTTIN: return "background tty read";
  701. #endif
  702. #ifdef SIGTTOU
  703.     case SIGTTOU: return "background tty write";
  704. #endif
  705. #ifdef SIGURG
  706.     case SIGURG: return "urgent I/O condition";
  707. #endif
  708. #ifdef SIGUSR1
  709.     case SIGUSR1: return "user-defined signal 1";
  710. #endif
  711. #ifdef SIGUSR2
  712.     case SIGUSR2: return "user-defined signal 2";
  713. #endif
  714. #ifdef SIGVTALRM
  715.     case SIGVTALRM: return "virtual time alarm";
  716. #endif
  717. #ifdef SIGWINCH
  718.     case SIGWINCH: return "window changed";
  719. #endif
  720. #if defined(SIGXCPU) && (!defined(SIGEMT) || (SIGXCPU != SIGEMT))
  721.     case SIGXCPU: return "exceeded CPU time limit";
  722. #endif
  723. #ifdef SIGXFSZ
  724.     case SIGXFSZ: return "exceeded file size limit";
  725. #endif
  726.     }
  727.     return "unknown signal";
  728. }
  729.